package nespresso.beans;

public class User {

	private String id, nom, prenom, role, login, email, password;
	
	public User(){
		this.id       = "-NEW-";
		this.nom      = "Nom";
		this.prenom   = "Prénom";
		this.role     = "GUEST";
		this.login    = "anonyme";
		this.email    = "adresse@email.fr";
	}
	
	public User(String id, String nom, String prenom, String role, String login, String email, String password){
		this.id       = id;
		this.nom      = nom;
		this.prenom   = prenom;
		this.role     = role;
		this.login    = login;
		this.email    = email;
		this.password = password;
	}
	
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}
	
	public void setNom(String nom) {
		this.nom = nom;
	}
	
		public String getPrenom() {
		return prenom;
	}
	
	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}
	
	public String getRole() {
		return role;
	}
	
	public void setRole(String role) {
		this.role = role;
	}
	
	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	public boolean InsertUser(String pwd) {
		boolean ok = false;
		
		Base bu = new Base();
		ok = bu.InsertUser(this, pwd);
		return ok;
	}
	
	public boolean DeleteUser() {
		boolean ok = false;
		
		Base bu = new Base();
		ok = bu.DeleteUser(this.getId());
		return ok;
	}
}
